//随机验证码
function myRandom() {
    var list = chars();
    var arr = [];
    var j;
    while (true) {
        j = Math.round(Math.random() * (list.length - 4));
        if (arr.indexOf(list[j]) == -1) {
            arr.push(list[j]);
        }
        if (arr.length == 4) break;
    }
    return arr.join("");
}

//3.获取数字数组
function numList() {
    var numList = [];
    for (var i = 48; i <= 57; i++) {
        var char = String.fromCharCode(i); //根据编码返回对应的字符
        numList.push(char);
    }
    return numList;
}

//4.获取大写字母数组
function maxList() {
    var maxList = [];
    for (var i = 65; i <= 90; i++) {
        var char = String.fromCharCode(i); //根据编码返回对应的字符
        maxList.push(char);
    }
    return maxList;
}

//5.获取小写字母数组
function minList() {
    var minList = [];
    for (var i = 97; i <= 122; i++) {
        var char = String.fromCharCode(i); //根据编码返回对应的字符
        minList.push(char);
    }
    return minList;
}

//7.获取大小写数字
function chars() {
    var chars = numList().concat(maxList(), minList());
    return chars;
}